package main

import (
	"my-gin-tiktok/global"
	"my-gin-tiktok/setup"
)

func main() {
	setup.InitConfig()
	global.App.Log = setup.InitLogger()
	global.App.Redis = setup.InitRedis()
	global.App.DB = setup.InitDatabase()
	global.App.Oss = setup.InitMinioClient()
	defer func() {
		if global.App.DB != nil {
			db, _ := global.App.DB.DB()
			_ = db.Close()
		}
	}()
	setup.RunServer()
}
